<?php
namespace app\console\validate;

use think\Validate;

class Member extends Validate
{
    protected $rule = [
        ['username', 'unique:member'],
        ['password', 'require|length:6,18',],
        ['confirm_password', 'require|confirm:password'],
    ];

    protected $message = [
        'username.unique'          => '用户名已存在',
        'password.require'         => '请填写密码',
        'password.length'          => '密码长度小于6位或大于18位',
        'confirm_password.require' => '请填写确认密码',
        'confirm_password.confirm' => '确认密码不一致',
    ];

    protected $scene = [
        'create' => ['username', 'password', 'confirm_password'],
        'update' => ['username'],
    ];
}